//
//  LsBasePageExtension.m
//  MIC_MoveModelExample
//
//  Created by 李爽 on 15/11/17.
//  Copyright (c) 2015年 Shawn Li. All rights reserved.
//  作为需要定位和搜索的基类

#import "LsBasePageExtension.h"
#import "LsLocation.h"

@interface LsBasePageExtension () <LsLocationDelegate>
{
    LsLocation *_location;
}

@end

@implementation LsBasePageExtension

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setNavBarImage];
    [self setNavigationLeftView:@"北京"];//默认值
    [self setNavigationRightView];
    [self setStatusBarStyle:UIStatusBarStyleLightContent];//设置状态栏位为白色
    [self reloadLocation];
}

- (void)reloadLocation {
    //网络状态提示
    [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
    
    _location = [[LsLocation alloc] init];
    _location.delegate = self;
    [_location startLocation];
}

- (void)didLocationCity:(NSString *)cityName {
    [self setNavigationLeftView:cityName];
    
    [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}

- (void)didLocationAddress:(NSString *)address {
    [LsGlobal alertMessage:address];
}

//重写父类LsBaseController方法
- (void)doLocation:(UIButton *)sender {
    [self reloadLocation];
}


@end
